<?php
namespace app\member\controller;

/**
 * 基础控制器
 */

class MemberController extends \app\index\controller\SiteController {

    public $userInfo = [];

    public function checkLogin() {
        $login = \Dux::cookie()->get('user_login');
        if(empty($login)) {
            return false;
        }
        if(!target('member/Member', 'service')->checkUser($login['uid'], $login['token'])) {
            return false;
        }
        $this->userInfo = target('member/Member', 'service')->getUser($login['uid']);
        return true;
    }

}